package com.jsoft.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * @author:sha
 * @email:o68o4741@163.com
 * @date:2023/2/21
 */
public class TicketDetail implements Serializable {
    private static final long serialVersionUID = 3327141230448166003L;
    private Integer id;
    private String no;
    private String openEnterprise;
    private String openSocialUniformCode;
    private String receiveEnterprise;
    private String receiveSocialUniformCode;
    private String institution;
    private Date openTime;
    private Date transferTime;
    private Date expiryTime;
    private String remark;
    /**
     * 处理状态
     */
    private String status;
    /**
     * 进度状态
     */
    private String progressStatus;
    private Double amount;
    /**
     * 付息方式
     */
    private String paymentInterestType;

    public TicketDetail() {
    }

    public TicketDetail(String no, String openEnterprise, String openSocialUniformCode, String receiveEnterprise, String receiveSocialUniformCode, String institution, Date openTime, Date transferTime, Date expiryTime, String remark, String status, String progressStatus, Double amount, String paymentInterestType) {
        this.no = no;
        this.openEnterprise = openEnterprise;
        this.openSocialUniformCode = openSocialUniformCode;
        this.receiveEnterprise = receiveEnterprise;
        this.receiveSocialUniformCode = receiveSocialUniformCode;
        this.institution = institution;
        this.openTime = openTime;
        this.transferTime = transferTime;
        this.expiryTime = expiryTime;
        this.remark = remark;
        this.status = status;
        this.progressStatus = progressStatus;
        this.amount = amount;
        this.paymentInterestType = paymentInterestType;
    }

    @Override
    public String toString() {
        return "TicketDetail{" +
                "id=" + id +
                ", no='" + no + '\'' +
                ", openEnterprise='" + openEnterprise + '\'' +
                ", openSocialUniformCode='" + openSocialUniformCode + '\'' +
                ", receiveEnterprise='" + receiveEnterprise + '\'' +
                ", receiveSocialUniformCode='" + receiveSocialUniformCode + '\'' +
                ", institution='" + institution + '\'' +
                ", openTime=" + openTime +
                ", transferTime=" + transferTime +
                ", expiryTime=" + expiryTime +
                ", remark='" + remark + '\'' +
                ", status='" + status + '\'' +
                ", progressStatus='" + progressStatus + '\'' +
                ", amount=" + amount +
                ", paymentInterestType='" + paymentInterestType + '\'' +
                '}';
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getNo() {
        return no;
    }

    public void setNo(String no) {
        this.no = no;
    }

    public String getOpenEnterprise() {
        return openEnterprise;
    }

    public void setOpenEnterprise(String openEnterprise) {
        this.openEnterprise = openEnterprise;
    }

    public String getOpenSocialUniformCode() {
        return openSocialUniformCode;
    }

    public void setOpenSocialUniformCode(String openSocialUniformCode) {
        this.openSocialUniformCode = openSocialUniformCode;
    }

    public String getReceiveEnterprise() {
        return receiveEnterprise;
    }

    public void setReceiveEnterprise(String receiveEnterprise) {
        this.receiveEnterprise = receiveEnterprise;
    }

    public String getReceiveSocialUniformCode() {
        return receiveSocialUniformCode;
    }

    public void setReceiveSocialUniformCode(String receiveSocialUniformCode) {
        this.receiveSocialUniformCode = receiveSocialUniformCode;
    }

    public String getInstitution() {
        return institution;
    }

    public void setInstitution(String institution) {
        this.institution = institution;
    }

    public Date getOpenTime() {
        return openTime;
    }

    public void setOpenTime(Date openTime) {
        this.openTime = openTime;
    }

    public Date getTransferTime() {
        return transferTime;
    }

    public void setTransferTime(Date transferTime) {
        this.transferTime = transferTime;
    }

    public Date getExpiryTime() {
        return expiryTime;
    }

    public void setExpiryTime(Date expiryTime) {
        this.expiryTime = expiryTime;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        if(Objects.equals(status, "A")){
            this.status="成功";
        } else if (Objects.equals(status, "B")){
            this.status = "转让中";
        }else if (Objects.equals(status, "C")) {
            this.status = "失败";
        }
    }

    public String getProgressStatus() {
        return progressStatus;
    }

    public void setProgressStatus(String progressStatus) {
        if(Objects.equals(status, "A")){
            this.status="已签收";
        } else if (Objects.equals(status, "B")){
            this.status = "未签收";
        }
    }

    public Double getAmount() {
        return amount;
    }

    public void setAmount(Double amount) {
        this.amount = amount;
    }

    public String getPaymentInterestType() {
        return paymentInterestType;
    }

    public void setPaymentInterestType(String paymentInterestType) {
        if (Objects.equals(paymentInterestType, "A")) {
            this.paymentInterestType = "融资方付息";
        } else if (Objects.equals(paymentInterestType, "B")) {
            this.paymentInterestType = "核心企业付息";
        }
    }
}
